/*
 * XML Type:  EEnum
 * Namespace: http://www.eclipse.org/emf/2002/Ecore
 * Java type: org.eclipse.emf.x2002.ecore.EEnum
 *
 * Automatically generated - do not modify.
 */
package org.eclipse.emf.x2002.ecore.impl;
/**
 * An XML EEnum(@http://www.eclipse.org/emf/2002/Ecore).
 *
 * This is a complex type.
 */
public class EEnumImpl extends org.eclipse.emf.x2002.ecore.impl.EDataTypeImpl implements org.eclipse.emf.x2002.ecore.EEnum
{
    private static final long serialVersionUID = 1L;
    
    public EEnumImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ELITERALS$0 = 
        new javax.xml.namespace.QName("", "eLiterals");
    
    
    /**
     * Gets array of all "eLiterals" elements
     */
    public org.eclipse.emf.x2002.ecore.EEnumLiteral[] getELiteralsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ELITERALS$0, targetList);
            org.eclipse.emf.x2002.ecore.EEnumLiteral[] result = new org.eclipse.emf.x2002.ecore.EEnumLiteral[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "eLiterals" element
     */
    public org.eclipse.emf.x2002.ecore.EEnumLiteral getELiteralsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumLiteral target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumLiteral)get_store().find_element_user(ELITERALS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "eLiterals" element
     */
    public int sizeOfELiteralsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ELITERALS$0);
        }
    }
    
    /**
     * Sets array of all "eLiterals" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setELiteralsArray(org.eclipse.emf.x2002.ecore.EEnumLiteral[] eLiteralsArray)
    {
        check_orphaned();
        arraySetterHelper(eLiteralsArray, ELITERALS$0);
    }
    
    /**
     * Sets ith "eLiterals" element
     */
    public void setELiteralsArray(int i, org.eclipse.emf.x2002.ecore.EEnumLiteral eLiterals)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumLiteral target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumLiteral)get_store().find_element_user(ELITERALS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(eLiterals);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "eLiterals" element
     */
    public org.eclipse.emf.x2002.ecore.EEnumLiteral insertNewELiterals(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumLiteral target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumLiteral)get_store().insert_element_user(ELITERALS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "eLiterals" element
     */
    public org.eclipse.emf.x2002.ecore.EEnumLiteral addNewELiterals()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumLiteral target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumLiteral)get_store().add_element_user(ELITERALS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "eLiterals" element
     */
    public void removeELiterals(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ELITERALS$0, i);
        }
    }
}
